# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=syntax-highlighting
pkgver=6.7.0
pkgrel=0
pkgdesc="Syntax highlighting engine for structured text and code"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="MIT"
depends_dev="
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	xerces-c-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	perl
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/syntax-highlighting.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/syntax-highlighting-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build -E "(test|html)highlighter_test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
764de790328c0fd6623740701ff3461f85c68e464b09ba63feb26cae8d33180e20a584589a9671662ef2cf8edb683b64cc4417edbb4a0663b7d34e54def5d697  syntax-highlighting-6.7.0.tar.xz
"
